package com.blensmile.utils;

import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.blensmile.App;
import com.blensmile.R;
import com.blensmile.utils.DensityUtils;

/**
 * Created by Blensmile on 2016/11/14.
 */
public class ImageToast{
    private static int DEFAULT_WIDTH = DensityUtils.dip2px(App.app,120);
    private static Toast mToast;
    private static TextView text;

    public static void showSingleToast(String message){
        if(mToast == null || text == null){
            View view = LayoutInflater.from(App.app).inflate(R.layout.img_toast_layout,null);
            ImageView img = (ImageView) view.findViewById(R.id.img_circle);
            text = (TextView) view.findViewById(R.id.tv_msg);
            img.setImageResource(R.drawable.report);
            mToast = new Toast(App.app);
            mToast.setGravity(Gravity.CENTER, 0, 0);
            mToast.setView(view);
        }
        text.setText(message);
        mToast.show();
    }


}
